package com.rcadmin.busi.admin.dao;

import java.util.List;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Component;

import com.rcadmin.busi.admin.ddl.SysUser;
import com.rcadmin.common.contant.IsEff;
import com.rcadmin.core.jpa.BaseDao;
import com.rcadmin.core.jpa.DaoException;

/**
 * 系统用户
 * 
 */
@Component
public class SysUserDao {
	@Resource
	public BaseDao baseDao;

	/**
	 * 查找商家用户
	 * 
	 * @param userName
	 * @return
	 * @throws DaoException
	 */
	public List<SysUser> findUser(String userName) {
		if (StringUtils.isEmpty(userName))
			throw new IllegalArgumentException("userName should not be null");
		return baseDao.find(" user_name='" + userName + "' and iseff='"
				+ IsEff.EFFECTIVE + "'", SysUser.class);
	}

}
